package com.demo;

public class LazyMan {
    public LazyMan() {
        System.out.println(Thread.currentThread().getName() + "----LazyMan----");
    }

    private static LazyMan lazyMan;

    public static LazyMan getInstance() {
        if (lazyMan == null) {
            synchronized (LazyMan.class) {
                if (lazyMan == null) {
                    lazyMan = new LazyMan();
                }
            }
        }
        return lazyMan;
    }

}
